
// Copyright (C) Recursion Company. All rights reserved.

#include "stdafx.h"
#include "vol_user_app_info.h"

//-----------------------------------------------------------------------------------------

BOOL CVWnd_Spin::CreateControl (CVolNativeWndCreateParam* pCreateParam)
{
    CRect rt (pCreateParam->m_nLeft, pCreateParam->m_nTop, pCreateParam->m_nLeft + pCreateParam->m_nWidth, pCreateParam->m_nTop + pCreateParam->m_nHeight);

    if (Create (pCreateParam->m_hParentWnd, rt,
            pCreateParam->m_szCaption, pCreateParam->m_dwStyle, pCreateParam->m_dwExStyle, pCreateParam->m_nID, NULL) != NULL)
    {
        ModifyWndStyleEx (this, 0, pCreateParam->m_dwExStyle);

        MoveWindow (&rt);
        return TRUE;
    }

    return FALSE;
}

LRESULT CVWnd_Spin::OnDeltapos (LPNMHDR pnmh)
{
    if (m_pEventListener != NULL)
        m_pEventListener->OnDeltapos (((LPNMUPDOWN)pnmh)->iDelta < 0 ? 1 : -1);

    return 0;
}
